import { execSync } from "node:child_process";

const ENV_KEYS = ["SHELL", "NAME", "PWD", "HOME", "LANG", "USER", "LOGNAME"];

export function getEnvs(): string {
    let values: string[] = [];

    for (let envKey of ENV_KEYS) {
        let value = process.env[envKey];
        if (value) {
            values.push(`${envKey}=${value}`);
        }
    }

    return values.join("\n");
}

export function getOSRelease(): string {
    const osRelease = execSync("cat /etc/os-release").toString();
    return osRelease;
}
